﻿<phone:PhoneApplicationPage
    x:Class="DnD.CardPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="False"
    Style="{StaticResource TransitionPageStyle}">
    


    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot"  Hold="CardView_Hold">
        <Grid.Background>
            <ImageBrush  Stretch="None" ImageSource="{Binding  BackGroundImageSource}" />
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="39*"/>
           
            
            <RowDefinition Height="104*"/>
            <RowDefinition Height="113*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.Row="0" Margin="10,0,10,0">
            <TextBlock Text="CARD" Style="{StaticResource PhoneTextNormalStyle}"/>
            <Border BorderThickness="5" Height="79" BorderBrush="{StaticResource BorderColor}" Background="{StaticResource BackgroundColor}" Margin="0,0,0,0" >
                <TextBlock Text="{Binding SelectedCard.Name }" Margin="10,0,10,10" Style="{StaticResource CardHeaderTextStyle}"/>
            </Border>
            
        </StackPanel>
                <!--ContentPanel - place additional content here-->
        <Border Grid.Row="1" BorderThickness="5" BorderBrush="{StaticResource BorderColor}" Background="{StaticResource BackgroundColor}" Margin="30,0,30,0" >
            <Image Source="{Binding SelectedCard.PictureURL}"  Width="410" Height="340" Stretch="UniformToFill"/>
        </Border>
        <Border Grid.Row="2" BorderThickness="5" BorderBrush="{StaticResource BorderColor}" Background="{StaticResource BackgroundColor}" Margin="10,10,10,24" >
            <Grid> 
                <Grid.RowDefinitions>
                    <RowDefinition Height="2*"/>
                    <RowDefinition Height="2*"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <ListBox  Grid.Row="0"  ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Disabled" ItemsSource="{Binding Actions}" >
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel    Orientation="Horizontal"/>
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" >
                                <Border  Margin="2"   CornerRadius="10"   BorderThickness="3" Width="50" Height="50" BorderBrush="{StaticResource BorderColor}" Background="{StaticResource BorderColor}">
                                    <Image Source="{Binding PictureURL}"  Width="48" Height="48" Stretch="UniformToFill" />
                                </Border>
                                <TextBlock  Text="X" VerticalAlignment="Center" Style="{StaticResource CardDescTextStyle}"  />
                                <TextBlock  Text="{Binding Amount}" VerticalAlignment="Center" Style="{StaticResource CardActionAmountTextStyle}"  />
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>


                <TextBlock Grid.Row="1" TextWrapping="Wrap"  Text="{Binding SelectedCard.Description}" Margin="10,10,10,10" Style="{StaticResource CardDescTextStyle}"/>
                <Border Grid.Row="2" Margin="309,0,5,5" Background="{StaticResource BorderColor}"  BorderThickness="0" CornerRadius="10"> 
                <toolkit:Rating   RatingItemCount="5" Value="{Binding SelectedCard.Rate}"  Width="125" Height="25" Background="Transparent">
                        <toolkit:Rating.FilledItemStyle>
                            <Style TargetType="toolkit:RatingItem">
                                <Setter Property="Background" Value="White" />
                            </Style>
                        </toolkit:Rating.FilledItemStyle>
                        <toolkit:Rating.UnfilledItemStyle>
                            <Style TargetType="toolkit:RatingItem">
                                <Setter Property="Background" Value="{StaticResource BackgroundColor}" />
                            </Style>
                        </toolkit:Rating.UnfilledItemStyle>
                    </toolkit:Rating>
                </Border>
            </Grid>
        </Border>
    </Grid>

</phone:PhoneApplicationPage>